<?php
namespace app\erp\validate;

use think\Validate;
class Attrrule extends Validate{
    protected $rule = [
        'attr_name' => 'require|unique:attr,attr_name^category_sign',
        'value_item' => 'requireCallback:check_require'
    ];
    protected $message = [
        'attr_name.require' => '属性名称必须填写',
        'attr_name.unique' => '属性名称已在当前分类下存在',
        'value_item.requireCallback' => '数据类型为固定值时必须填写数据可选值'
    ];
    protected $scene = [
        'edit' => [
           // 'attr_name' => 'unique:attr,attr_name^category_sign',
            'sort' => 'number'
        ]
    ];
}
